﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TranTekBE.Kho
{
    public partial class ChiTiecHangChuyen : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string id=Request.QueryString["ChuyenHangId"];
            string sql = @"Select  item.C001203 [Mã Thuốc],item.C001204 [Tên Thuốc], unit.C004002 [Đơn Vị] ,CONVERT(INT, T0024.C002405) [Số Lượng],T0024.C002411 [Ghi Chú]  from T0024
   Left Join T0025 ORDER_RECEIVE on T0024.C002401 = ORDER_RECEIVE.C002501  
   Left Join T0023 ord on ORDER_RECEIVE.C002508 = ord.C002301  Left Join T0040 
    unit on T0024.C002404 = unit.C004000  Left Join T0022 vendor 
    on T0024.C002402 = vendor.C002200  Left Join T0012 item on T0024.C002406 = item.C001200 
     Where item.C001207 in (0, 1) and ord.C002301 = '" +id+@"'  
      order by T0024.C002406 asc , T0024.UC00001 asc , T0024.C002408 asc  ";
         var ds=   ThuVien.FunctionsUtils.Database.ExecuteQuery(sql);
         if (ds.Tables.Count > 0)
         {
             GridView1.DataSource = ds.Tables[0];
             GridView1.DataBind();
         }
        }
    }
}